<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="jquery.min.js"></script>
    <script src="qrcode.min.js"></script>
    <title>上课</title>
    <style>
        html,body{
            height:100%;
        }
        body{
            background: #dee1e6;
            overflow: hidden;
        }
        #qrcode{
            position: absolute;
            top:20%;
            left: 35%;
            height:500px;
            width:500px;
        }
        #des {
            position: absolute;
            top: 5%;
            left: 40%;
            font-size: 2em;
        }
    </style>
</head>
<body>
    <div id="qrcode"></div>
    <div id="des"><p>扫描下方二维码签到</p></div>
</body>
<script>
    let pwd = getQueryString('pwd');
    let qrcode = new QRCode(document.getElementById("qrcode"), {width: 500,height: 500});
    qrcode.makeCode(pwd);

    function getQueryString(name) {
        let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        let r = encodeURI(window.location.search).substr(1).match(reg);
        if (r != null)
            return unescape(r[2]);
        return null;
    }
</script>
</html>